<template>
  <div class="app-container">
    <FileList @file-selected="handleFileSelected" />
    <VtkWorld2 v-if="selectedFile" :filename="selectedFile" />
  </div>
</template>

<script setup>
  import { ref, defineAsyncComponent } from 'vue';
  import FileList from './components/FileList.vue';
  // import VtkWorld from './components/VtkWorld.vue';
  import VtkWorld2 from './components/VtkWorld2.vue';
  // import VtkWorld3 from './components/VtkWorld3.vue';

  const selectedFile = ref(null);

  const handleFileSelected = (filename) => {
    selectedFile.value = filename; // 触发 VtkViewer 渲染
  };
</script>

<style>
body {
  margin: 0;
  font-family: Arial, sans-serif;
}
.app-container {
  display: flex;
  height: 100vh;
}
</style>